package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.lmx.repoDomain.tmodel.business.User;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

// 活动计划模板（模板）
@JsonApiResource(type = "customeractivityplanserviceitem")
@Table(name = "tnb_activityplan_serviceitem")
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CustomerActivityPlanServiceItem extends BaseEntity {

	private Integer createDateTime;// 创建时间
	
	private CustomerActivityProjectItem item;// 老人活动方案项目表ID packageitemID
	
	private String remark;// 备注
	
	private Customer customer; // 客户ID customerID
	
	private Integer weekTab;// 周标记
	
	private Integer monthTab;// 月标记

	private String startTimeTab;// 小时标记
	
	private User createUser; // 创建人

	private Integer lastUpdateDateTime;// 更新时间

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}
	
	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
    @Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "customerID", foreignKey = @ForeignKey(name = "null"))
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	@Column(name = "starttime_tab")
	public String getStartTimeTab() {
		return startTimeTab;
	}

	public void setStartTimeTab(String startTimeTab) {
		this.startTimeTab = startTimeTab;
	}

	@Column(name = "week_tab")
	public Integer getWeekTab() {
		return weekTab;
	}

	public void setWeekTab(Integer weekTab) {
		this.weekTab = weekTab;
	}
	
	@JsonApiToOne
	@JsonApiIncludeByDefault
    @Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}
	
	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
    @Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "packageitemID", foreignKey = @ForeignKey(name = "null"))
	public CustomerActivityProjectItem getItem() {
		return item;
	}

	public void setItem(CustomerActivityProjectItem item) {
		this.item = item;
	}
	
	@Column(name = "month_tab")
	public Integer getMonthTab() {
		return monthTab;
	}

	public void setMonthTab(Integer monthTab) {
		this.monthTab = monthTab;
	}
}
